
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul{
      display: flex;
    }
    li{
      
      list-style: none;
      margin: 15px;
    }
    .active{
      background-color: red;
    }
  </style>
</head>
<body>
  <script src="../js/vue.js"></script>
  <div id="app">
    <ul>
      <li :class="index == 0 ? 'active' : ''" @click="fn(0)">这是第1张图片</li>
      <li :class="index == 1 ? 'active' : ''" @click="fn(1)">这是第2张图片</li>
      <li :class="index == 2 ? 'active' : ''" @click="fn(2)">这是第3张图片</li>
      <li :class="index == 3 ? 'active' : ''" @click="fn(3)">这是第4张图片</li>
      <li :class="index == 4 ? 'active' : ''" @click="fn(4)">这是第5张图片</li>
      <li :class="index == 5 ? 'active' : ''" @click="fn(5)">这是第6张图片</li>
      <li :class="index == 6 ? 'active' : ''" @click="fn(6)">这是第7张图片</li>
      <li :class="index == 7 ? 'active' : ''" @click="fn(7)">这是第8张图片</li>
    </ul>
    <button @click="index--" v-show="index > 0">上一张</button>


    <img :src="list[index]" alt="">

    
    <button @click="index++" v-show="index <list.length - 1 ">下一张</button>
  </div>
  
  <script>
   const app = new Vue({
      el:'#app',
      data:{
        index:0,
        list:[
          './imgs/10-01.png',
          './imgs/10-02.png',
          './imgs/11-00.gif',
          './imgs/11-01.gif',
          './imgs/11-02.gif',
          './imgs/11-03.gif',
          './imgs/11-04.png',
          './imgs/11-05.png',
        ]
      },
      methods: {
        fn(i){
          this.index = i
        }
      },
    })
  </script>
</body>
</html>